/**
 * 编号生成工具函数
 */

/**
 * 生成基于时间戳的唯一编号
 * 格式：YYYYMMDDHHMMSSMMM（年月日时分秒毫秒）
 * @returns {string} 生成的唯一编号
 */
export const generateUniqueNo = (): string => {
  const now = new Date();
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  const hours = String(now.getHours()).padStart(2, '0');
  const minutes = String(now.getMinutes()).padStart(2, '0');
  const seconds = String(now.getSeconds()).padStart(2, '0');
  const milliseconds = String(now.getMilliseconds()).padStart(3, '0');
  
  return `${year}${month}${day}${hours}${minutes}${seconds}${milliseconds}`;
};

/**
 * 生成合同号
 * @returns {string} 生成的合同号
 */
export const generateContractNo = (): string => {
  return generateUniqueNo();
};

/**
 * 生成费用单号
 * @returns {string} 生成的费用单号
 */
export const generateOfficeCostNo = (): string => {
  return generateUniqueNo();
};